package sort;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @ClassName: leetcode TestFianll @Description: sort @Author: 逸伦 @Date: 2022/10/16 17:41 @Version:
 * 1.0
 */
public class TestFianll {

    private static final Map<String, List<String>> map = new ConcurrentHashMap(12);

    public void add(String key, String val) {
        if (map.containsKey(key)) {
            List<String> strings = map.get(key);
            strings.add(val);
        } else {
            List<String> init = new ArrayList<>();
            init.add(val);
            map.put(key, init);
        }
        System.out.println("当前map的数据是=" + map.toString());
    }

    public void delete(String key) {
        map.remove(key);
        System.out.println("当前map的数据是=" + map.toString());
    }

    public static void main(String[] args) {
        try {
            TestFianll testFianll = new TestFianll();
            testFianll.add("1", "1");
            testFianll.add("1", "2");
            testFianll.add("1", "3");
            testFianll.add("1", "4");
            testFianll.add("2", "4");
            testFianll.add("3", "4");
            testFianll.delete("1");
        } finally {
            Object o = new Object();
            System.out.println("finally打印的");
        }
    }
}
